package com.usian.controller;

import com.usian.VO.Result;
import com.usian.service.FeignServiceMemLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 * 作者：m鹏h
 * 时间；2023/8/22 11:01
 * 描述：
 **/
@RestController
@RequestMapping("memLogin")
public class memLoginController {
    @Autowired
    private FeignServiceMemLogin feignServiceMemLogin;

    @GetMapping("login")
    public Result login(String username,String password){
        String token = feignServiceMemLogin.findMember(username, password);
        if (token!=null){
            return Result.Success(token);
        }else {
            return Result.Error();
        }
    }

}
